/**
 * <p>
 * </p>
 *
 * @author zhuolin
 * @since 2020/5/27
 */
public class JoinThread {

    public volatile static int i = 0;

    public static class AddThread extends Thread {
        @Override
        public void run() {
            for (; i < 100000; i++) {
                System.out.println(i);
            }
        }
    }

    public static void main(String[] args) throws InterruptedException {
        AddThread t = new AddThread();
        t.start();
        t.join();
        System.out.println(i);
    }
}
